[#include "/WEB-INF/pages/common/taglibs.ftl"]
[@c.url var="deleteUrl" value="/manage/Channel_delete.action"]
	[@c.param name="backurl" value="${action.currentUrl}"/]
[/@c.url]
[@c.url var="backUrl" value="/manage/Channel_list.action" /]
<ul>
	[#list channelList as channel]
    <li><a href="#tabs-${channel_index+1}" [#if channel.status=='1'] style="color:red;"[/#if]>${channel.title}</a></li>
   	[/#list]
    <li><a href="#tabs-[#if channelList?? && channelList.size()>0]${channelList.size()+1}[#else]1[/#if]">新建频道</a></li>
</ul>
[#list channelList as channel]
	<div id="tabs-${channel_index+1}">
		<form action="[@c.url value="/manage/Channel_update.action"][@c.param name="backurl" value="${backUrl}"/][@c.param name="idx" value="${channel_index+1}"/][/@c.url]" method="post" class="stdform stdform2 validate">
			<p>
	        	<label>标题：</label>
	            <span class="field"><input class="smallinput" rel="${action.getValidateMetadata("/manage", "Channel_update", "channel.title")}" name="channel.title" value="${(channel.title)!''}"/></span>
	        </p>
	        <p>
	        	<label>路径：</label>
	            <span class="field"><input class="tinyinput" rel="${action.getValidateMetadata("/manage", "Channel_update", "channel.path")}" name="channel.path" value="${(channel.path)!''}"/></span>
	        </p>
			<p>
        		<label>模板：</label>
            	<span class="field"><select name="channel.templateId" rel="${action.getValidateMetadata("/manage", "Channel_update", "channel.templateId")}">
					<option value=""></option>
					[#list templateList as template]
						<option value="${template.id}" [#if template.id == channel.templateId]selected='selected'[/#if]>${template.name}</option>
					[/#list]
				</select>&nbsp;<a href="javascript:;" class="anchorbutton button_editor template_edit"><span>编辑</span></a></span>
        	</p>
			<p>
        		<label>语言：</label>
            	<span class="field"><select name="channel.i18n">
					<option value=""></option>
					[#if (configI18N.configItemList)??]
						[#list configI18N.configItemList as item]
							<option value="${item.value}" [#if item.value == channel.i18n]selected='selected'[/#if]>${item.name}</option>
						[/#list]
					[/#if]
				</select>
				<!--&nbsp;<a href="javascript:;" class="anchorbutton button_editor"><span>编辑</span></a>-->
				</span>
        	</p>
        	<p>
	        	<label>状态：</label>
	            <span class="field">
	            	可用：<input type="radio" name="channel.enabled" value="true" [#if channel == null || (channel.enabled ==true)]checked[/#if]/>
					禁用：<input type="radio" name="channel.enabled" value="false" [#if (channel != null && channel.enabled == false)]checked[/#if]/>
	            </span>
	        </p>
        	<p>
	        	<label>类型：</label>
	            <span class="field">
	            	默认频道：<input type="checkbox" name="default" value="true" [#if channel != null && (channel.status =='1')]checked="checked"[/#if]/>
	            </span>
	        </p>
        	<p>
	        	<label>说明：</label>
	            <span class="field">
	            	<small>在没有指定频道时,作为缺省频道</small></br>
	            	<small>站点只能有一个默认频道,如果已存在默认频道,则重新设置将对原默认将被自动设置成普通频道.</small>
	            </span>
	        </p>
	        <p class="stdformbutton">
		    	<input type="hidden" name="id" value="${channel.id}" />
				<input type="hidden" name="channel.id" value="${channel.id}" />
		      	<button class="submit ">更&nbsp;&nbsp;新</button>
		        <input type="reset" value="重&nbsp;&nbsp;置" class="reset radius2" />
		        [#--<input class="channel_review" type="button" value="预览" act="eidt" ckey="${channel.id}"/>--]
		        <a class="anchorbutton button_trash" href="${deleteUrl}&id=${channel.id}" style="margin-left:6px;"><span>删&nbsp;&nbsp;除</span></a>
		        <a class="anchorbutton button_alert" href="${action.currentUrl}" style="margin-left:6px;"><span>返&nbsp;&nbsp;回</span></a>&nbsp;&nbsp;
		        <a href="javascript:;" class="anchorbutton button_glass" act="eidt" ckey="${channel.id}"><span>预&nbsp;&nbsp;览</span></a>
		    </p>					
		</form>
	</div>
[/#list]
<div id="tabs-[#if channelList?? && channelList.size() > 0]${channelList.size()+1}[#else]1[/#if]">
	<form action="[@c.url value="/manage/Channel_save.action"][@c.param name="backurl" value="${backUrl}"/][@c.param name="idx" value="${channelList.size()+1}"/][/@c.url]" method="post" class="stdform stdform2 validate">
		<p>
        	<label>标题：</label>
            <span class="field"><input class="smallinput" name="channel.title" rel="${action.getValidateMetadata("/manage", "Channel_save", "channel.title")}"/></span>
        </p>
        <p>
        	<label>路径：</label>
            <span class="field"><input class="tinyinput" rel="${action.getValidateMetadata("/manage", "Channel_save", "channel.path")}" name="channel.path" /></span>
        </p>
		<p>
    		<label>模板：</label>
        	<span class="field"><select name="channel.templateId" rel="${action.getValidateMetadata("/manage", "Channel_save", "channel.templateId")}">
				<option value=""></option>
				[#list templateList as template]
					<option value="${template.id}">${template.name}</option>
				[/#list]
			</select>&nbsp;<a href="javascript:;" class="anchorbutton button_editor template_edit"><span>编辑</span></a></span>
    	</p>
		<p>
    		<label>语言：</label>
        	<span class="field"><select name="channel.i18n">
				<option value=""></option>
				[#list configI18N.configItemList as item]
					<option value="${item.value}">${item.name}</option>
				[/#list]
			</select>&nbsp;<a href="javascript:;" class="anchorbutton button_editor i18n_edit"><span>编辑</span></a></span>
    	</p>
		<p>
        	<label>状态：</label>
            <span class="field">
            	可用：<input type="radio" name="channel.enabled" value="true" />
				禁用：<input type="radio" name="channel.enabled" value="false"/>
            </span>
        </p>
        <p class="stdformbutton">
	      	<button class="submit ">提&nbsp;&nbsp;交</button>
	        <input type="reset" value="重&nbsp;&nbsp;置" class="reset radius2" />&nbsp;&nbsp;
	        <!--<input class="channel_review" type="button" value="预览" act="new"/>-->
	        <a class="anchorbutton button_alert" href="${action.backurl}"><span>返&nbsp;&nbsp;回</span></a>
	    </p>	
	</form>
</div>